package com.fjj.cs.enums;


import com.fjj.cs.service.ResultCode;

/**
 * description 错误码
 *
 */
public enum ErrorCode implements ResultCode {
  SUCCESS("1000", "请求成功!"),
  ILLEGAL_PARAMETER("1001", "参数错误!"),
  WHITELIST_VERIFICATION_FAIL("1002", "白名单校验失败!"),
  REQUEST_REPLAY("1003", "重复提交!"),
  VALIDATION_FAILED("1004", "签名校验失败!"),
  APP_NOT_FOUND("1005", "未找到对应的应用!"),
  DATA_NOT_FOUND("1006", "资源未找到!"),
  REQUEST_TIME_OUT("1007", "请求超时!"),
  LIMIT_VALIDATION_FAILED("1009", "请求过于频繁!"),
  CHAIN_DATA_NOT_FOUND("1010", "存证信息为空!"),
  DEVICE_NOT_FOUND("1011", "未找到对应的设备!"),
  DEVICE_APP_NOT_BIND("1012", "设备与应用不匹配!"),
  APP_STOP("1013", "应用被停用!"),
  SECRET_ID_ERROR("1014", "secret_id不正确!"),
  DEVICE_STOP("1014", "设备已停用!"),
  SERVCIE_STOP("1015", "设备服务已停用!"),
  DEVICE_NOT_SERVCIE("1016", "设备未订购服务!"),
  USER_PACKAGE_NOT_FOUND("1017", "未找到套餐信息!"),
  USER_PACKAGE_FINISH("1018", "套餐已用尽或已失效!"),
  DATA_STATUS_ERROR("1019", "消息状态异常!"),
  DEVICE_NOT_SHARE("1020", "设备无上级!"),
  DEVICE_SERVCIE_EXPIRE("1021", "服务已过期，请咨询客户经理续费!"),
  DEVICE_USER_NOT_FOUND("1022", "设备用户未找到!"),
  DEVICE_USER_PASS_ERROR("1023", "设备用户密码错误!"),

  CSRF_TOKEN_EXPIRE("2001", "csrfToken过期"),
  AUTH_TOKEN_EXPIRE("2002", "认证令牌过期"),
  USER_LOGIN_OUT("2004", "用户退出登录"),
  USER_ALREADY_LOGIN("1007", "用户已经在其他地方重新登录"),

  NOT_LOGIN("2000", "未登录"),
  ACCESS_DENIED("2003", "权限不足"),
  DATA_EMPTY("3001", "请求结果为空!"),
  OVER_MAX_SIZE("3002", "请求的数据超过最大条数!"),
  UNERROR("9998", "服务器内部错误!"),
  ERROR("9999", "请求失败!"),
  EXCEL_ERROR("4001", "excel格式错误!"),
  ;

  private String code;
  private String msg;

  private ErrorCode(String code, String msg) {
    this.code = code;
    this.msg = msg;
  }

  ;

  @Override
  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  @Override
  public String toString() {
    final StringBuffer sb = new StringBuffer("ErrorCode{");
    sb.append("code=").append(code);
    sb.append(", msg='").append(msg).append('\'');
    sb.append('}');
    return sb.toString();
  }
}
